package farmer.gui;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;

import core.gui.GlassPane;
import farmer.game.InGameMenuState;

public class InGameMenuGUI {
	
	public static int resume = 0;
	public static int restart = 1;
	public static int quit = 2;
	
	private GlassPane glassPane;
	
	InGameMenuButton resumeButton;
	InGameMenuButton restartButton;
	InGameMenuButton quitButton;
	
	public InGameMenuGUI(InGameMenuState state){
		glassPane = state.getGlassPane();
		
		resumeButton = new InGameMenuButton("Reprendre la partie", resume, state);
		restartButton = new InGameMenuButton("Nouvelle partie", restart, state);
		quitButton = new InGameMenuButton("Quitter la partie", quit, state);
		
		glassPane.addComponent(resumeButton);
		resumeButton.setPosition(275, 200);
		glassPane.addComponent(restartButton);
		restartButton.setPosition(275, 280);
		glassPane.addComponent(quitButton);
		quitButton.setPosition(275, 345);
	}
	
	public void render(Graphics2D g){
		g.setColor(new Color(188, 187, 143));
		g.fillRect(260, 185, 280, 225);
		g.setStroke(new BasicStroke(7));
		g.setColor(Color.black);
		g.drawRoundRect(260, 185, 280, 225, 10, 10);
		g.setStroke(new BasicStroke(5));
		g.drawLine(260, 265, 540, 265);
		glassPane.draw(g);
	}
	
	

}
